package xyz.imeans.w.service.core;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;
import xyz.imeans.w.config.FieldEnum;
import xyz.imeans.w.config.InitCreateFactory;
import xyz.imeans.w.util.LngLatUtil;

@Service
public class LngLatService extends TestService implements InitializingBean {
    @Override
    public void afterPropertiesSet() throws Exception {
        InitCreateFactory.initService(FieldEnum.LNG_LAT, this);
    }

    @Override
    public Object createValue(String[] os) {
        String[] split = String.valueOf(os[0]).split(",");
        return LngLatUtil.create(Double.valueOf(split[1]), Double.valueOf(split[0]), Double.valueOf(os[1]) / 1000);
    }
}
